﻿<Window x:Class="_06.ResourceStyle.Resource.NumberResource"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:System="clr-namespace:System;assembly=mscorlib" Title="NumberResource" Height="107" Width="333">
    <Window.Resources>
        <!--note: we cannot use a number as the resource, because actually that number will be converted
        so we have to use the target class or type
        when we use a number as margin, actually we are using class 'Thickness'
        so here we define the resource, we cannot use number, but use 'Thickness' class-->
        <Thickness x:Key="Margin" 
                   Left="10"
                   Top="5"
                   Right="10"
                   Bottom="5"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        <Label Content="Label: "  
               VerticalContentAlignment="Center"  
               HorizontalContentAlignment="Right" 
               Margin="{StaticResource Margin}"/>
        <TextBox Grid.Column="1" Grid.ColumnSpan="2"  
                 Margin="{StaticResource Margin}"/>
        <Button Content="OK" Grid.Row="1"  Grid.Column="1"  
                Margin="{StaticResource Margin}"/>
        <Button Content="Cancel" Grid.Row="1"  Grid.Column="2"  
                Margin="{StaticResource Margin}"/>
    </Grid>
</Window>
